package Practica

class BudgetController {

   
    def save = {
        def budget = new Budget(params)
        if(!budget.hasErrors() && budget.save()){
            flash.message ="Budget ${budget.id} created"
            redirect(action:show,id:budget.id)
        }
        else{
            
            flash.message ="no sal enada"
            render(view:'create',model:[budget:budget])  }
     
    }
    
    def scaffold = Budget
 
}